the_count = [1 ,2 ,3 , 4, 5]
fruits = ['apples', 'oranges', 'pears','apricots']
change = [1, 'pennies', 2, 'dimes', 3, 'quarters']

#this first kind of for-loop goes through an array
for number in the_count
  puts "This is count #{number}"
end    #for 循环语句，number 代表阵列里面到内容

# same as above, but using a block instead
fruits.each do |fruit|
  puts "A fruit of type:#{fruit}"
end   # 用each do ||代替for循环，用在长阵列，块状阵列

# also we can go through mixed arrays too
for i in change
  puts "I got #{i}"
end   #跟第一个例句差不多，用i代表阵列里面到内容

# we can also build arrays, first start with an empty one 
elements = []

# then use a range object to do 0 to 5 counts
for i in (0 ... 5)
  puts "Adding #{i} to the list."
  # push is a function that arrays understand
  elements.push(i)
end

#now we can puts them out too
for i in elements
  puts "Element was:#{i}"
end
#这里用elements代表一个阵列，i 定义阵列里面的内容，然后进行for循环，这里面就是（0...5）这里有点问题，中间到...表示连续，怎么用不很清楚，range的类别我没查出来，在string文档里面打不开

#range就是范围的意思, 你可以理解成数学里面的区间, 但不一样的是, 这里是离散的敬意, 也就是只会有这当中的几个整数值, 不包括当中其他的实数.
#..和...是两个运算符, 用来产生range, http://my4java.itpub.net/post/9983/55333, 至于详细的文档, 你自己要学着查一下gem怎么用, 怎么下载rdoc, 怎么在本地启动gem server, 怎么查看本地已经安装的gem包的文档, 这些你先搜一下, 至于网上的文档, http://ruby-doc.org/core-1.9.3/Range.html

You can
